extends Area2D

@onready var timer: Timer = $Timer

func _on_body_entered(body: Node2D) -> void:
	# 杀死玩家，重启游戏
	if body is CharacterBody2D and get_parent().is_dide == false:
		body.game_over()
		Engine.time_scale = 0.4
		timer.start()

# 重启场景
func _on_timer_timeout() -> void:
	Engine.time_scale = 1 #游戏时间流速变化
	get_tree().reload_current_scene()
